{extend name="public/base"}

{block name="x-body"}
    <div class="x-body">
      <blockquote class="layui-elem-quote">
        <span style="color: red;">提示：搜索日期条件将开始日和结束日填写完整，否则将为无效搜索</span>
      </blockquote>
      <div class="layui-row">
        <form class="layui-form layui-col-md12 x-so" method="get">
          <div class="layui-input-inline">
            <select name="type">
              <option value="">全部类型</option>
              <option value="0" {$search_key.type === '0' ? 'selected' : ''}>仅退款</option>
              <option value="1" {$search_key.type == 1 ? 'selected' : ''}>退货退款</option>
              <option value="2" {$search_key.type == 2 ? 'selected' : ''}>换货</option>
            </select>
          </div>

          <input type="text" name="order_sn"  placeholder="请输入订单号" autocomplete="off" class="layui-input" value="{$search_key.order_sn}">
          <button class="layui-btn"  lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
        </form>
      </div>
      <xblock>
        <button class="layui-btn layui-btn-danger" onclick="delAll('{:url(\'orders/return_del\')}')"><i class="layui-icon"></i>批量删除</button>
        <span class="x-right" style="line-height:40px">共有数据：{$list -> total()} 条</span>
      </xblock>
      <table class="layui-table">
        <thead>
          <tr>
            <th>
              <div class="layui-unselect header layui-form-checkbox" lay-skin="primary"><i class="layui-icon">&#xe605;</i></div>
            </th>
            <th>ID</th>
            <th>订单编号</th>
            <th>商品名称</th>
            <th>类型</th>
            <th>申请日期</th>
            <th>状态</th>
            <th>操作</th>
            </tr>
        </thead>
        <tbody>
          {volist name="list" id="v"}
            <tr>
              <td>
                <div class="layui-unselect layui-form-checkbox" lay-skin="primary" data-id='{$v.id}'><i class="layui-icon">&#xe605;</i></div>
              </td>
              <td>{$v.id}</td>
              <td>{$v.order_sn}</td>
              <td>{$v.goods_name|interceptStr=###, 30}（{$v.spec_key_name}）</td>
              <td>{if $v.type == 1}退货退款{elseif $v.type == 2 /}换货{else /}仅退款{/if}</td>
              <td>{$v.addtime|date="Y-m-d H:i"}</td>
              <td>
                {switch name="v.status"}
                  {case value="-2"}用户已取消{/case}
                  {case value="-1"}审核不通过{/case}
                  {case value="0"}待审核{/case}
                  {case value="1"}审核通过{/case}
                  {case value="2"}已发货{/case}
                  {case value="3"}已收货{/case}
                  {case value="4"}换货完成{/case}
                  {case value="5"}退款完成{/case}
                {/switch}
              </td>
              <td class="td-manage">
                <a title="编辑"  onclick="x_admin_show('退货物处理', '{:url(\'orders/return_form\', [\'id\' => $v.id])}')" href="javascript:;">
                  <i class="layui-icon">&#xe642;</i>
                </a>
                <a title="删除" onclick="member_del(this,'{$v.id}', '{:url(\'orders/return_del\')}')" href="javascript:;">
                  <i class="layui-icon">&#xe640;</i>
                </a>
              </td>
            </tr>
          {/volist}
        </tbody>
      </table>
      <div class="page">
        {$list -> render()|raw}
      </div>

    </div>
{/block}